package ${package_name}.DAO;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.auth.manager.core.dto.UserInfoDto;
import com.yonyou.dcs.common.Constant;
import com.yonyou.dcs.common.bean.ElemBean;
import com.yonyou.dcs.common.util.DcsDaoUtil;
import com.yonyou.dcs.common.util.StringUtils;
import com.yonyou.dcs.common.util.UserUtil;
import com.yonyou.dcs.marketSupport.service.common.DealerInfoCommonService;
import com.yonyou.dmsgms.framework.DAO.PageInfoDto;

/**
* 描述：${table_annotation} 数据层
* @author ${author}
* @date ${date}
*/
@Repository
public class ${table_name}DAO {


    public PageInfoDto getInfoByPage(ElemBean condition){
        List<Object> queryParam = new ArrayList<Object>();
		StringBuffer query = new StringBuffer(); 
		
		getSql(condition,queryParam,query);
        return DcsDaoUtil.pageQuery(query.toString(), queryParam);
    }
    
     public void getSql(ElemBean condition,List<Object> queryParam,StringBuffer query){
    
         //区分厂端店端
         query.append(DcsDaoUtil.getOrgSqlByOrgType("act.PLAN_ORG_ID", UserUtil.getSessionUser()));
    }

    @SuppressWarnings("rawtypes")
	public Map getInfoById(String id){
    
        List<Object> queryParam = new ArrayList<Object>();
		StringBuffer query = new StringBuffer();
		ElemBean condition = new ElemBean();
		condition.put("id", id);
		getSql(condition,queryParam,query);
        List<Map> list =  DcsDaoUtil.findAll(query.toString(), queryParam);
        
        return list != null && list.size() > 0 ? list.get(0) :  null;
    }
   
   
   
  }